import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:flutter/material.dart' as prefix0;
import 'package:flutter/rendering.dart';


void main(List<String> args) {
  runApp(MyApp()) ;
}


//自定义组件  圓形圖片
class MyApp extends StatelessWidget {
  const MyApp({Key key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar:AppBar(
          title: Text("flutter demo"),
        ),
        body:HomeContent(),
      ),
      theme: ThemeData(
        // brightness: Brightness.light,
        primarySwatch: Colors.yellow
      ),
    );
  }
}


// class HomeContent extends StatelessWidget {
//   const HomeContent({Key key}) : super(key: key);
//   @override
//   Widget build(BuildContext context) {
//     return Center(
//       child:Container(
//         width: 300.0,
//         height: 300.0,
//         decoration:BoxDecoration(
//           color:  Colors.blue,
//           border: Border.all(width: 2.0,color: Colors.black54),
//           borderRadius: BorderRadius.circular(25.0),
//           image: DecorationImage(
//             image:NetworkImage("https://res11.bignox.com/player/www/ca9b622cce8d0dfe3f94787738dcd16c/FHFFEADDCb64ECb.png"),
//             fit:BoxFit.cover
//           )
//         )
//       )
//     );
//   }
// }


class HomeContent extends StatelessWidget {
  const HomeContent({Key key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Center(
      //圓角設置
      // child: ClipRRect(
      //   borderRadius: BorderRadius.circular(20),
      //   child: Image.network(
      //     "https://res11.bignox.com/player/www/ca9b622cce8d0dfe3f94787738dcd16c/FHBKBBDAC2G3cdP.jpg",
      //     width: 300,
      //     height: 300,
      //     fit: BoxFit.cover,
      //   ),
      // )
      //固定圓角
      // child: ClipOval(
      //   child: Image.network(
      //     "https://res11.bignox.com/player/www/ca9b622cce8d0dfe3f94787738dcd16c/FHBKBBDAC2G3cdP.jpg",
      //     width: 300,
      //     height: 300,
      //     fit: BoxFit.cover,
      //   ),
      // ),
      //本地圖片
      child: ClipRRect(
        borderRadius: BorderRadius.circular(20),
        child: Image.asset(
          "images/a.jpeg",
          width: 300,
          height: 300,
          fit: BoxFit.cover,
        ),
      )
    );
  }
}

